﻿<script setup>
// setup()
import {ref} from 'vue'

let countN = 0 //非响应式

const count = ref(0)
console.log(count)

function Nincrement() {
  countN++
  console.log("countN值" + countN)
}

function increment() {
  count.value++
  console.log("count值" + count)
  console.log("count值" + count.value)
}
</script>

<template>
  <h1>响应式示例</h1>
  <button @click="Nincrement">非响应式Count值是: {{ countN }}</button>
  <button @click="increment">响应式Count值是: {{ count }}</button>
</template>

<style scoped>
button {
  font-weight: bold;
}
</style>